// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'

Vue.config.productionTip = false

/* eslint-disable no-new */
const Vnode = new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App) // 函数h的实参是createElement函数
});

// window.addEventListener('error', (event) => {
//   console.log(event); // 通过该方法无法检测到错误
// })

Vue.config.errorHandler = function (err, vm, info) {
  // handle error
  // `info` 是 Vue 特定的错误信息，比如错误所在的生命周期钩子
  // 只在 2.2.0+ 可用
  console.log("====正在触发错误上报机制====");
  console.log(info);
  console.log(err);
  console.log(vm);
  alert("上报错误信息");
  console.log("======错误上报完毕======");
}

